import axios from '../utils/http'; // 导入http中创建的axios实例
import { Base64 } from '../utils/base';
let baseObj = new Base64()
const base_url = process.env.BASE_API;
const inter_url = '/proxy/cam/proxy/common?api=';

const repairApi = {
  // 获取卡券
  getCoupon(params) {
    let url = 'CustomerSolicitFacade-getCoupon'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
  // 维修预约单新增
  addRepairBooking(params) {
    let url = 'CustomerSolicitFacade-addRepairBooking'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  // 维修预约单列表查询
  queryRepairBooking(params) {
    let url = 'CustomerSolicitFacade-queryRepairBooking'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
  // 维修预约单详情
  queryRepairBookingById(params) {
    let url = 'CustomerSolicitFacade-queryRepairBookingById'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  /* 维修工单 */
  // 维修工单列表
  queryRepairWorkOrder(params) {
    let url = 'CustomerSolicitFacade-queryRepairWorkOrder'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  // 维修工单详情
  queryRepairWorkOrderById(params) {
    let url = 'CustomerSolicitFacade-queryRepairWorkOrderById'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
  // 取消维修单
  cancelRepairBooking(params) {
    let url = 'CustomerSolicitFacade-cancelRepairBooking'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
  // 申请结算
  repairWorkOrderSetOver(params) {
    let url = 'CustomerSolicitFacade-repairWorkOrderSetOver'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
}

export default repairApi;
